package com.yf.service.impl;

import com.yf.dao.UserDao;
import com.yf.entity.UserEntity;
import com.yf.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.yf.dao.AccountDao;
import com.yf.entity.AccountEntity;
import com.yf.service.AccountService;
import com.yf.service.impl.BaseServiceImpl;

/**
 * 账户Service实现类
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Oct 24 13:54:17 CST 2018
 */
@Service
public class AccountServiceImpl extends BaseServiceImpl<AccountEntity> implements AccountService {
    @Autowired
    private AccountDao accountDao;

    @Autowired
    private UserDao userDao;


    /**内部方法**/


    /**外部方法实现**/
    public UserVO getAccount(Long userId){
        UserVO userVO = accountDao.getAccount(userId);
        //查询推荐人信息
        UserEntity parent = userDao.get(userVO.getParentId());
        userVO.setParentName(parent.getName());
        return userVO;
    }
}
